<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>原料仓库管理系统</title>
</head>
<?php
session_start();
if ($_SESSION['username']!=null){
	
}else{
	 echo"<script type='text/javascript'>location='CKGL-index.php';
			</script>";
}
require('lianjie.php');
?>
<link rel="stylesheet" type="text/css" href="css/tou.css" />
<link rel="stylesheet" type="text/css" href="css/daohanglan.css" />
<link rel="stylesheet" type="text/css" href="css/ckgl_no1.css" />
<script type="text/javascript" src="js/tuichuDL.js"></script>
<body style=" background-color:#09F; background-repeat:no-repeat;
               background-attachment:fixed;
               background-size:100% 100%;">
<div class="box">
    <header>
    <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;原料仓库管理系统</h2>
    
    </header>
    <div class="YH"><p><?php echo $_SESSION['username'];?><input type="button" name="bt1" onclick="c1()" value="退出" /></p></div>
    <div class="box_DH">
    <ul>

        <li><a href="CKGL_no1.php">logo</a></li>
        <li><a href="CKGL_no1.php">首页</a></li>
        <li><a href="CKGL_cksj.php">查看数据</a></li>
        <li><a href="CKGL_cw.php">查看储位</a></li>
        <li><a href="CKGL_rk.php">入库</a></li>
        <li><a href="CKGL_ck.php">出库</a></li>
        <li><a href="CKGL_zk.php">转库</a>
        </li>
        <li><a href="CKGL_plupdata.php">批量修改</a>
        </li>
        <li><a>生成报表</a>
            <ul>
                <li><a href="CKGL_zdy.php">生成自定义表</a></li>
                <li><a href="CKGL_rbb.php">生成一般报表</a></li>
            </ul>
         </li>
    </ul>
    </div>
    <div class="box_ZL">
    <table>
    <?php
    
    $sqlr="select sum(SW),sum(BS) from rkb;";
    $sqlc="select sum(SW),sum(BS) from ckb;";
    if(mysqli_select_db($connID,$dbName)){
        $resultr=mysqli_query($connID,$sqlr);
        $myrowr=mysqli_fetch_array($resultr);
        $resultc=mysqli_query($connID,$sqlc);
        $myrowc=mysqli_fetch_array($resultc);
        if($myrowr){
                
    ?>
    <tr>
        <td align="left">总存量(T)</td>
        <td align="right" style="color:rgb(0,255,0);">总</td>
    </tr>
    <tr>
        <td align="left">-------------------------------</td>
        <td align="right">------</td>
    </tr>
    <tr>
    <td align="left"  style="font-size:22px; color:red;">&nbsp;<span class="STYLE2"><?php echo ($myrowr[0]-$myrowc[0])*0.001;?></span></td>
    </tr>
    <tr>
        <td align="left">-------------------------------</td>
        <td align="right">------</td>
    </tr>
    <tr>
        <td align="left">总包数</td>
        <td align="right" style="color:rgb(0,0,0);"><span class="STYLE2"><?php echo $myrowr[1]-$myrowc[1];?></span></td>
    </tr>
    <?php 
        }
    }
    ?>
    </table>
    </div>
    <div class="box_RCK">
    <table>
    <?php
    $sqlrc="select sum(SW),sum(BS) from ckb where dh_date='".date('y-m-d')."';";
    if(mysqli_select_db($connID,$dbName)){
        $resultrc=mysqli_query($connID,$sqlrc);
        $myrowrc=mysqli_fetch_array($resultrc);
        if($myrowrc){
                
    ?>
    <tr>
        <td align="left">日出库量(T)</td>
        <td align="right" style="color:rgb(0,0,255);">出</td>
    </tr>
    <tr>
        <td align="left">-------------------------------</td>
        <td align="right">------</td>
    </tr>
    <tr>
    <td align="left"  style="font-size:22px;">&nbsp;<span class="STYLE2"><?php echo $myrowrc[0]*0.001;?></span></td>
    </tr>
    <tr>
        <td align="left">-------------------------------</td>
        <td align="right">------</td>
    </tr>
    <tr>
        <td align="left">日出库包数</td>
        <td align="right" style="color:rgb(0,0,0);"><span class="STYLE2"><?php echo $myrowrc[1];?></span></td>
    </tr>
    <?php 
        }
    }
    ?>
    </table>
    </div>
    <div class="box_RRK">
    <table>
    <?php
    $sqlrr="select sum(SW),sum(BS) from rkb where dh_date='".date('y-m-d')."';";
    if(mysqli_select_db($connID,$dbName)){
        $resultrr=mysqli_query($connID,$sqlrr);
        $myrowrr=mysqli_fetch_array($resultrr);
        if($myrowrr){
                
    ?>
    <tr>
        <td align="left">日入库量(T)</td>
        <td align="right" style="color:rgb(255,0,0);">入</td>
    </tr>
    <tr>
        <td align="left">-------------------------------</td>
        <td align="right">------</td>
    </tr>
    <tr>
    <td align="left"  style="font-size:22px;">&nbsp;<span class="STYLE2"><?php echo $myrowrr[0]*0.001;?></span></td>
    </tr>
    <tr>
        <td align="left">-------------------------------</td>
        <td align="right">------</td>
    </tr>
    <tr>
        <td align="left">日入库包数</td>
        <td align="right" style="color:rgb(0,0,0);"><span class="STYLE2"><?php echo $myrowrr[1];?></span></td>
    </tr>
    <?php 
        }
    }
    ?>
    </table>
    </div>
    <div class="box_WLCLL">
    <table>
    <?php
    $sqldclr="select sum(SW),sum(BS) from rkb where LBLB like '%进料%';";
    $sqldclc="select sum(SW),sum(BS) from ckb where LBLB like '%进料%';";
    if(mysqli_select_db($connID,$dbName)){
        $resultdclr=mysqli_query($connID,$sqldclr);
        $myrowdclr=mysqli_fetch_array($resultdclr);
        $resultdclc=mysqli_query($connID,$sqldclc);
        $myrowdclc=mysqli_fetch_array($resultdclc);
        if($myrowdclr){
                
    ?>
    <tr>
        <td align="left">进料加工量(T)</td>
        <td align="right" style="color:rgb(255,0,255);">进</td>
    </tr>
    <tr>
        <td align="left">-------------------------------</td>
        <td align="right">------</td>
    </tr>
    <tr>
    <td align="left"  style="font-size:22px;">&nbsp;<span class="STYLE2"><?php echo ($myrowdclr[0]-$myrowdclc[0])*0.001;?></span></td>
    </tr>
    <tr>
        <td align="left">-------------------------------</td>
        <td align="right">------</td>
    </tr>
    <tr>
        <td align="left">进料加工包数</td>
        <td align="right" style="color:rgb(0,0,0);"><span class="STYLE2"><?php echo $myrowdclr[1]-$myrowdclc[1];?></span></td>
    </tr>
    <?php 
        }
    }
    ?>
    </table>
    </div>
    <div class="box_YTB">
    <canvas id="ntb" width="530" height="300"></canvas>
    <script src="echarts.min.js"></script>
    <script>
    var uri1=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-01%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-01%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri2=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-02%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-02%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri3=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-03%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-03%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri4=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-04%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-04%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri5=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-05%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-05%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri6=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-06%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-06%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri7=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-07%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-07%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri8=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-08%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-08%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri9=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-09%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-09%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri10=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-10%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-10%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri11=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-11%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-11%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri12=<?php 
        if(mysqli_select_db($connID,$dbName)){
            $resultr=mysqli_query($connID,"select sum(SW) from rkb where dh_date like'".date('Y')."-12%';");
            $resultc=mysqli_query($connID,"select sum(SW) from ckb where dh_date like'".date('Y')."-12%';");
            if($myrowr=mysqli_fetch_array($resultr) and $myrowc=mysqli_fetch_array($resultc)){
                echo $myrowr[0]+$myrowc[0];
                }
            }
    ?>;
    var uri=[uri1,uri2,uri3,uri4,uri5,uri6,uri7,uri8,uri9,uri10,uri11,uri12];
    
    var myChart3 = echarts.init(document.querySelector(".box_YTB"));
    
    option3 = {
        title: {
            text: '月出入库图表'
        },
        toolbox: {
            show: true,
            feature: {
                saveAsImage: {}
            }
        },
        tooltip: {},
            legend: {
            data:['出入库总量']
        },
        xAxis: {
            data: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]
        },
        yAxis: {},
        series: [{
            name: '出入库总量',
            type: 'bar',
            data: uri,
        }]
    };
    myChart3.setOption(option3);
    /*Chart(uri);
    
    function Chart(data){
        var canvas=document.getElementById("ntb");
        var ctx=canvas.getContext("2d");
        
        //计算坐标
        var grid_cols=14;
        var grid_rows=10;
        var cell_width=canvas.width/grid_cols;
        var cell_height=canvas.height/grid_rows;
        ctx.beginPath();
        ctx.fillStyle="#000";
        ctx.font="bold 10px Arial";
        ctx.textAlign="center";
        ctx.textBaseline="top";
        //横坐标的属性
        for(var col=2;col<=13;col++)
        {
            var x=col*cell_width;
            var til=col-1+'月';
            ctx.fillText(til,x,9.5*cell_height);
        }
        
        //标题
        ctx.fillStyle="#cc0000";
        ctx.font="bold 20px Arial";
        ctx.fillText("每月出入库总量",7*cell_width,2);
        //画横轴
        ctx.moveTo(cell_width,9*cell_height);
        ctx.lineTo(canvas.width,9*cell_height);
        for(var col=1;col<grid_cols;col++)
        {
            var x=col*cell_width;
            ctx.moveTo(x,9*cell_height);
            ctx.lineTo(x,9.25*cell_height);
        }
        //画纵轴
        ctx.moveTo(cell_width,9*cell_height);
        ctx.lineTo(cell_width,0);
        for(var col=1;col<grid_rows;col++)
        {
            var y=col*cell_height;
            ctx.moveTo(cell_width,y);
            ctx.lineTo(0.75*cell_width,y);
        }
        ctx.lineWidth=1;ctx.strokeStyle="#000";
        ctx.stroke();
        //获取数据中最大值
        var max_v=0;
        for(var i=0;i<data.length;i++)
        {
            if(data[i]>max_v)
            max_v=data[i];
        }
        
        ctx.beginPath();
        max_v=max_v*1.2;
        var y=9*cell_height/max_v;
        var x=cell_width;
        ctx.fillStyle="#000";
        ctx.font="bold 10px Arial";
        ctx.textAlign="center";
        ctx.textBaseline="center";
        //纵坐标的数值
        for(var col=0;col<=8;col++)
        {
            var til=parseInt(col*cell_height/y*0.0001);
            ctx.fillText(til,0.5*x,(9-col)*cell_height);
        }
        //画柱状图
        for(var i=0;i<=12;i++){
        
        ctx.moveTo((1.7+i)*x,9*cell_height);
        ctx.lineTo((1.7+i)*x,y*(max_v-data[i]));
        ctx.lineTo((2.3+i)*x,y*(max_v-data[i]));
        ctx.lineTo((2.3+i)*x,9*cell_height);
        
        var til=parseInt(data[i]*0.0001);
        ctx.fillText(til,(1.7+i)*x+4,y*(max_v-data[i])-10);
        }
        ctx.lineWidth=1;
        ctx.strokeStyle="#000";
        ctx.fillStyle="#0000cc";
        ctx.fill();
        ctx.stroke();
        
    }
    */
    </script>
    </div>
    <div class="box_ZTB">
    
    <canvas id="ntb2" width="530" height="300"></canvas>
    <script type="text/javascript">
    /**/var uri1=<?php 
    $sqltb="select sum(SW) from rkb where dh_date like'".date('Y-m')."%' group by dh_date;";
    if(mysqli_select_db($connID,$dbName)){
        $resulttb=mysqli_query($connID,$sqltb);
        echo "[";
        while($myrowtb=mysqli_fetch_array($resulttb)){
            echo $myrowtb[0].",";
            }
        }
        echo "]";
    ?>;
    var uri2=<?php 
    $sqltb="select sum(SW) from ckb where dh_date like'".date('Y-m')."%' group by dh_date;";
    if(mysqli_select_db($connID,$dbName)){
        $resulttb=mysqli_query($connID,$sqltb);
        echo "[";
        while($myrowtb=mysqli_fetch_array($resulttb)){
            echo $myrowtb[0].",";
            }
        }
        echo "]";
    ?>;
    
    var myChart4 = echarts.init(document.querySelector(".box_ZTB"));
    
    option8 = {
        title:{
            text:'每天出入库量'
            },
        tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'cross'
        }
      },
      toolbox: {
        show: true,
        feature: {
          saveAsImage: {}
        }
      },
      legend: {
            data:['入库','出库']
          },
      xAxis: {
        data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
      },
      yAxis: {},
      series: [
        {
            name:'入库',
          data: uri1,
          color:'green',
          type: 'line',
          smooth: true,
          
        },
        {
            name:'出库',
            data:uri2,
            color:'red',
            type:'line',
            smooth:true,
        }
      ]
    };
    myChart4.setOption(option8);
    /*for(var i=0;i<=30;i++){
        uri3[i]=uri1[i]-uri2[i];
        }
    var max_v=0;
        for(var i=0;i<uri1.length;i++)
        {
            if(uri1[i]>max_v)
            max_v=uri1[i];
        }
        for(var i=0;i<uri2.length;i++)
        {
            if(uri2[i]>max_v)
            max_v=uri2[i];
        }
        
    Chart2(uri1,uri2,max_v);
    
    
    function Chart2(data,data2,max_v){
        var canvas=document.getElementById("ntb2");
        var ctx=canvas.getContext("2d");
        
        //计算坐标
        var grid_cols=33;
        var grid_rows=10;
        var cell_width=canvas.width/grid_cols;
        var cell_height=canvas.height/grid_rows;
        ctx.beginPath();
        ctx.fillStyle="#000";
        ctx.font="bold 10px Arial";
        ctx.textAlign="center";
        ctx.textBaseline="top";
        //画横轴
        ctx.moveTo(cell_width,9*cell_height);
        ctx.lineTo(canvas.width,9*cell_height);
        for(var col=1;col<grid_cols;col++)
        {
            var x=col*cell_width;
            ctx.moveTo(x,9*cell_height);
            ctx.lineTo(x,9.25*cell_height);
        }
        //画纵轴
        ctx.moveTo(cell_width,9*cell_height);
        ctx.lineTo(cell_width,0);
        for(var col=1;col<grid_rows;col++)
        {
            var y=col*cell_height;
            ctx.moveTo(cell_width,y);
            ctx.lineTo(0.75*cell_width,y);
        }
        ctx.lineWidth=1;ctx.strokeStyle="#000";
        ctx.stroke();
    
        ctx.beginPath();
        max_v=max_v*1.2;
        var y=9*cell_height/max_v;
        var x=cell_width;
        
        //标题
        ctx.fillStyle="#cc0000";
        ctx.font="bold 20px Arial";
        ctx.fillText("每天出入库量",16*cell_width,2);
        
        ctx.fillStyle="#00cc00";
        ctx.font="bold 10px Arial";
        ctx.fillText("绿色入库",26*cell_width,4);
        ctx.fillStyle="#cc0000";
        ctx.fillText("红色出库",30*cell_width,4);
    
        
        ctx.textAlign="right";
        ctx.textBaseline="center";
        //将数据转换为坐标
        var points=[];
        for(var i=0;i<data.length;i++)
        {
            var v=data[i];
            var px=cell_width*(i+2);
            var py=y*(max_v-data[i]);
            points.push({"x":px,"y":py});
            
            var til=parseInt(data[i]*0.0001);
            ctx.fillText(til,cell_width*(i+2)+4,y*(max_v-data[i])-12);
        }
        //描绘折线
        ctx.beginPath();
        for(var i=0;i<points.length;i++)
        {
            ctx.lineTo(points[i].x,points[i].y);
        }
        ctx.lineWidth=2;
        ctx.strokeStyle="#00cc00";
        ctx.stroke();
        //绘制坐标
        for(var i in points){
            var p=points[i];
            ctx.beginPath();
            ctx.arc(p.x,p.y,4,0,2*Math.PI);
            ctx.fillStyle="#00cc00"
            ctx.fill();
        }
        
        
        var points2=[];
        for(var i=0;i<data2.length;i++)
        {
            var v=data2[i];
            var px=cell_width*(i+2);
            var py=y*(max_v-data2[i]);
            points2.push({"x":px,"y":py});
            
            var til=parseInt(data2[i]*0.0001);
            ctx.fillText(til,cell_width*(i+2)+4,y*(max_v-data2[i])-12);
        }
        //描绘折线
        ctx.beginPath();
        for(var i=0;i<points2.length;i++)
        {
            ctx.lineTo(points2[i].x,points2[i].y);
        }
        ctx.lineWidth=2;
        ctx.strokeStyle="#cc0000";
        ctx.stroke();
        //绘制坐标
        for(var i in points2){
            var p=points2[i];
            ctx.beginPath();
            ctx.arc(p.x,p.y,4,0,2*Math.PI);
            ctx.fillStyle="#cc0000"
            ctx.fill();
        }
        
    }
    */
    </script><!---->
    </div>
    <div class="box_CZJL">
    <table style="width:100%;">
    <tr><td>近期结存记录</td></tr>
    <tr>
    <td align="center">时间</td>
    <td align="center">名称</td>
    <td align="center">批号</td>
    <td align="center">手册号</td>
    <td align="center">结存数量</td>
    </tr>
    <?php
    if(mysqli_select_db($connID,$dbName)){
        $sqltsr="select r.dh_date,r.name,r.PH,r.id,r.s,c.s from (select dh_date,name,PH,id,sum(SW) as s,sum(BS) as b,LY,KQ,CW,YLLB,BLB,LBLB,LB1,LB2 from rkb group by name,PH,id) as r left join (select name,PH,id,sum(SW) as s,sum(BS) as b,QX from ckb where dh_date>='".date('Y-m-d',strtotime('-2 day'))."' and dh_date<='".date('Y-m-d')."' group by name,PH,id) as c on r.PH=c.PH and r.name=c.name and r.id=c.id where (r.dh_date='".date('Y-m-d',strtotime('-2 day'))."' or r.dh_date='".date('Y-m-d',strtotime('-1 day'))."' or r.dh_date='".date('Y-m-d')."');"/*"where rkb.dh_date>='".date('Y-m-d',strtotime("-1 week"))."' and rkb.dh_date<='".date('y-m-d')." and ckb.dh_date>='".date('Y-m-d',strtotime("-1 week"))."' and ckb.dh_date<='".date('y-m-d')."';"*/;
        
        $sqltsPD="select count(*) from rkb where dh_date>='".date('Y-m-d',strtotime("-2 day"))."' and dh_date<='".date('y-m-d')."';";
        $resulttsPD=mysqli_query($connID,$sqltsPD);
        $myrowtsPD=mysqli_fetch_array($resulttsPD);
        $resultts=mysqli_query($connID,$sqltsr);
        if($myrowtsPD[0]>=1){
            while($myrow=mysqli_fetch_array($resultts)){	
    ?>
    <tr>
        <td align="center"><span class="STYLE2"><?php echo $myrow[0];?></span></td>
        <td align="center"><span class="STYLE2"><?php echo $myrow[1];?></span></td>
        <td align="center"><span class="STYLE2"><?php echo $myrow[2];?></span></td>
        <td align="center"><span class="STYLE2"><?php echo $myrow[3];?></span></td>
        <td align="center"><span class="STYLE2"><?php echo $myrow[4]-$myrow[5];?></span></td>
    </tr>
    <?php 
            }
        }
        else{
    ?>
    <tr>
        <td align="center"><span class="STYLE2"><?php echo "暂无数据";?></span></td>
        <td align="center"><span class="STYLE2"><?php echo "暂无数据";?></span></td>
        <td align="center"><span class="STYLE2"><?php echo "暂无数据";?></span></td>
        <td align="center"><span class="STYLE2"><?php echo "暂无数据";?></span></td>
        <td align="center"><span class="STYLE2"><?php echo "暂无数据";?></span></td>
    </tr>
    <?php 
        }
    }
    ?>
    </table>
    
    </div>

</div>
</body>
</html>